package com.bw.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bw.entity.ZkUser;
import com.bw.service.IZkUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author szg
 * @since 2020-05-27
 */
@RestController
@CrossOrigin
@RequestMapping("/users")
public class ZkUserController {

    @Autowired
    private IZkUserService userService;

    @PostMapping("/tologin/{uname}/{pwd}")
    public List getLogin(@PathVariable String uname,@PathVariable String pwd){
        System.out.println("开始登录"+uname);
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("uname",uname);
        queryWrapper.eq("pwd",pwd);
        List list = userService.list(queryWrapper);
        return list;
    }
}
